package ch6;

public class TwoDimension {

	public static void main(String[] args) {
		// 二维数组
		int[][] ar = new int[5][30];
		ar[0][0] = 99;
		ar[0][3] = 100;
		ar[3][0] = 75;
		// 长度不一致
		int[][] a2 = { { 1, 2, 3, 4, 5, 6, 7 }, { 1, 2 }, { 3, 4, 5 }, { 4 } };
		// a2[1][3] = 99;
		int[][] a3 = { new int[5], new int[3], new int[19] };
		for (int i = 0; i < ar.length; i++) {
			for (int j = 0; j < ar[i].length; j++) {
				ar[i][j] = (int) (Math.random() * 100);
			}
		}
		for (int i = 0; i < ar.length; i++) {
			System.out.println("\n" + (i + 1) + "班成绩表：\n");
			for (int j = 0; j < ar[i].length; j++) {
				System.out.print(ar[i][j] + " ");
			}

		}
	}

}
